﻿using System.Configuration;

namespace LB.Server.Common
{

    public static class ServerConfiguration
    {
        public static WorkingSessionConfigurationSection SessionConfiguration;

        static ServerConfiguration()
        {
            Update();
        }

        public static void Update()
        {
            SessionConfiguration = (WorkingSessionConfigurationSection)System.Configuration.ConfigurationManager.GetSection("ServerConfiguration/WorkingSessionConfiguration");
        }
    }

    public class WorkingSessionConfigurationSection : ConfigurationSection
    {
        [ConfigurationProperty("defultDuration", DefaultValue = "300", IsRequired = true)]
        public int DefultDuration
        {
            get
            {
                return (int)this["defultDuration"];
            }
            protected set { this["defultDuration"] = value; }
        }
    }
}
